package com.xiaoyu.awakening.user.api;

import com.xiaoyu.awakening.common.core.dto.Page;
import com.xiaoyu.awakening.common.core.dto.Result;
import com.xiaoyu.awakening.user.dto.UserBriefDto;
import com.xiaoyu.awakening.user.dto.UserDto;
import com.xiaoyu.awakening.user.dto.req.CreateUserReq;
import com.xiaoyu.awakening.user.dto.req.EditUserPersonalReq;
import com.xiaoyu.awakening.user.dto.req.SearchUserReq;
import com.xiaoyu.awakening.user.dto.req.UpdateUserReq;
import com.xiaoyu.awakening.user.dto.res.UpdateUserRes;
import org.springframework.web.bind.annotation.*;

/**
 * 用户信息管理API
 *
 * @author wangxiaoyu
 * @since v1.0
 */
@RequestMapping("/api/v1/user")
public interface IUserControllerApi {
    @PostMapping(value = "/create")
    Result<Void> create(@RequestBody CreateUserReq createUserReq);

    @DeleteMapping(value = "/delete/{userId}")
    Result<String> delete(@PathVariable(value = "userId") Long userId);

    @PostMapping(value = "/update")
    Result<UpdateUserRes> update(@RequestBody UpdateUserReq updateUserReq);

    @PostMapping(value = "/edit")
    Result<String> edit(@RequestBody EditUserPersonalReq editUserPersonalReq);

    @PostMapping(value = "/search")
    Result<Page<UserDto>> search(@RequestBody SearchUserReq searchUserReq);

    @GetMapping(value = "/info/{userId}")
    Result<UserBriefDto> info(@PathVariable(value = "userId") Long userId);

    @GetMapping(value = "/details/{userId}")
    Result<UserDto> details(@PathVariable(value = "userId") Long userId);
}
